<?php

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::prefix('v1/categories/')->namespace('API')->group(function () {

    Route::get('/', 'CategoryController@index');
    Route::get('/{id}', 'CategoryController@list');
    Route::get('goods/{category_id}', 'CategoryController@getGoods');

});

Route::prefix('v1/goods/')->namespace('API')->group(function () {
    
    Route::get('/search', 'GoodsController@search');
    Route::get('/{id}', 'GoodsController@show');

});
